package com.kevms.phonewars;

import java.util.LinkedList;
import java.util.List;

/** 
* @class Player
* 
* @brief Houses Player information
* 
* This class keeps track of all necessary information about a Player.
*/ 
public class Player {
	private List<double[]> mineList = new LinkedList<double[]>();
	private double[] orientation = new double[3];
	private double[] position = new double[4];
	private String name;
	private int _id;
	private int kills;
	private int deaths;
	
	public Player() {

		position[0] = 0.0;
		position[1] = 0.0;
		position[2] = 0.0;
		
		orientation[0] = 0.0;
		orientation[1] = 0.0;
		orientation[2] = 0.0;
		
		_id = -1;
		kills = 0;
		deaths = 0;
		name = "";
	}
	
	public void setPosition(double x, double y, double z) {
		position[0] = x;
		position[1] = y;
		position[2] = z;
	}
	
	public void setPosition(double[] data) {
		position[0] = data[0];
		position[1] = data[1];
		position[2] = data[2];
	}
	
	public double[] getPosition() {
		return position;
	}
	
	public void setOrientation(double[] data) {
		orientation[0] = data[0];
		orientation[1] = data[1];
		orientation[2] = data[2];
	}
	
	public void setOrientation(float[] data) {
		orientation[0] = data[0];
		orientation[1] = data[1];
		orientation[2] = data[2];
	}
	
	public double[] getOrientation() {
		return orientation;
	}
	
	public void setName(String n) {
		name = n;
	}
	
	public String getName() {
		return name;
	}
	
	public void setId(int id) {
		_id = id;
	}
	
	public int getId() {
		return _id;
	}
	
	public void setKills(int s) {
		kills = s;
	}
	
	public void addKills(int s) {
		kills = kills + s;
	}
	
	public void subKills(int s) {
		kills = kills - s;
	}
	
	public int getKills() {
		return kills;
	}
	
	public void setDeaths(int s) {
		deaths = s;
	}
	
	public void addDeaths(int s) {
		deaths = deaths + s;
	}
	
	public void subDeaths(int s) {
		deaths = deaths - s;
	}
	
	public int getDeaths() {
		return deaths;
	}
	
	public int getScore() {
		return kills-deaths;
	}
	
	public void setMine(double[] data) {
		double[] loc = new double[2];
		loc[0] = data[0];
		loc[1] = data[1];
		mineList.add(loc);
	}
	
	public void detonateMines() {
		mineList.clear();
	}
	
	public List<double[]> getMineList() {
		return mineList;
	}
}
